package writtenexamination.weimeng.mianshi;
/**
 * @author cyt
 * @create 2020-10-17 下午 7:40
 */
public class Tb {

    public static void main(String[] args) {
        Tb tb = new Tb();
        System.out.println(tb.max(new int[]{1, 2, 3, 5, 4, 3, 2}));
        System.out.println(3 ^ 5);
    }

    //  数组a是前面一截是从小到大，后面是从大到小，找出最大值。
    int max(int[] a) {
        int ans = 0;
        for (int i = 0; i < a.length - 1; i++) {
            int temp = a[i + 1];
            if (a[i] > temp) {
                ans = a[i];
                break;
            }
        }
        return ans;
    }
}
